def get_number(prompt):
    while True:
        try:
            number = int(input(prompt))
            return number
        except ValueError:
            print("Invalid! Please enter a number.")
        
def get_positive_number(prompt):
    while True:
        number =get_number(prompt)
        if  number >=0:
            return number
        else:
            print("得是正数")

if __name__ == "__main__":
    print("你的年龄是：",get_positive_number("Enter your age: "))
    # print(get_number(""))